home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 September
/
Chip_2004-09_cd1.bin
/
program
/
delphi
/
download
/
nastroje
/
97.mpth_10[1].exe
/
{app}
/
scripts
/
Concat Files.mps
< prev
next >
Wrap
Text File
|
2003-09-21
|
960b
|
44 lines
= concat files (file.01, ...02,...)
var fname text, path text, filer text, datt text curline dword
var lenlf dword, pos dword, file1 file, ed file, dat file lines dword
fname = askopenfilename("Concat files: Chose data file", "Data files (*.dat)|*.dat", "dat"):= get data file
path = extractpath(fname)
file1 = fileopen(fname)
fileread file1 fname
datt = fname
fileclose file1
lines = 0
lenlf = textlen("\n")
@@L0
pos = textpos("\n", datt)
inc lines 1
datt = textcopy(datt, pos+lenlf)
if (datt != '')
goto L0
endif
curline = 0
ed = fileopen('::new', 'c')
@@L
pos = textpos("\n", fname)
filer = path+textcopy(fname, 1, pos-1)
fname = textcopy(fname, pos+lenlf)
if not fileexists(filer)
error "file ",filer," does not exist"
endif
dat = fileopen(filer)
fileread dat datt filesize(dat)
fileclose dat
filewrite ed datt
showprogress lines, curline
inc curline 1
if fname != ''
goto L
endif
showprogress 100